﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ModuleInPage.aspx.cs" Inherits="BitPortal.Admin.Page.ModuleInPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <ext:ResourceManager ID="ResourceManager1" runat="server">
        </ext:ResourceManager>
        <ext:Toolbar ID="Toolbar1" runat="server">
            <Items>
                <ext:Button runat="server" ID="btnAdd" Text="Thêm module" Icon="PluginAdd" Scale="Medium"
                    CausesValidation="false">
                    <DirectEvents>
                        <Click OnEvent="btnAdd_Click">
                            <EventMask ShowMask="true" Msg="Waiting..." MinDelay="500" />
                        </Click>
                    </DirectEvents>
                </ext:Button>
                <ext:ToolbarSeparator />
                <ext:Button runat="server" ID="btnEdit" Text="Sửa module" Icon="PluginEdit" Scale="Medium"
                    CausesValidation="false">
                    <DirectEvents>
                        <Click OnEvent="btnEdit_Click">
                            <EventMask ShowMask="true" Msg="Waiting..." MinDelay="500" />
                        </Click>
                    </DirectEvents>
                </ext:Button>
                <ext:ToolbarSeparator />
                <ext:Button runat="server" ID="btnDelete" Text="Xóa module" Icon="PluginDelete" Scale="Medium">
                    <DirectEvents>
                        <Click OnEvent="btnDelete_Click">
                            <EventMask ShowMask="true" Msg="Waiting..." MinDelay="500" />
                        </Click>
                    </DirectEvents>
                </ext:Button>
            </Items>
        </ext:Toolbar>
        <ext:Store ID="Store1" runat="server" OnRefreshData="Store1_RefreshData">
            <Reader>
                <ext:JsonReader IDProperty="ModuleID">
                    <Fields>
                        <ext:RecordField Name="ModuleID" Type="Auto" />
                        <ext:RecordField Name="Name" Type="String" />
                        <ext:RecordField Name="OnAllPage" Type="Boolean" />
                        <ext:RecordField Name="Position" Type="String" />
                        <ext:RecordField Name="SortOrder" Type="Int" />
                        <ext:RecordField Name="IsEnabled" Type="Boolean" />
                        
                    </Fields>
                </ext:JsonReader>
            </Reader>
        </ext:Store>
        <ext:GridPanel ID="GridPanel1" runat="server" AutoHeight="true" Title="Danh sách module"
            StoreID="Store1">
            <ColumnModel ID="ColumnModel1" runat="server">
                <Columns>
                    <ext:Column Header="Mã" DataIndex="ModuleID" Groupable="false" Width="20" Align="Center" />
                    <ext:Column Header="Tên module" DataIndex="Name" Align="Center" Groupable="false" />
                    <ext:Column Header="Vị trí" DataIndex="Position"  />
                    <ext:Column Header="Thứ tự hiển thị" DataIndex="SortOrder"  Align="Center" Groupable="false" />
                    <ext:Column Header="Hiển thị" DataIndex="IsEnabled" Align="Center" Width="30">
                        <Renderer Handler="return (value) ? 'Có':'Không';" />
                    </ext:Column>
                    <ext:Column Header="Hiển thị trên mọi trang" DataIndex="OnAllPage" Align="Center"
                        Width="30">
                        <Renderer Handler="return (value) ? 'Có':'Không';" />
                    </ext:Column>
                </Columns>
            </ColumnModel>
            <SelectionModel>
                <ext:CheckboxSelectionModel ID="CheckboxSelectionModel1" runat="server" />
            </SelectionModel>
            <View>
                <ext:GroupingView ID="GroupingView1" runat="server" ForceFit="true" MarkDirty="false"
                    ShowGroupName="true" EnableNoGroups="true" HideGroupedColumn="true" ShowGroupsText="Nhóm lại theo cột này" />
            </View>
            <LoadMask ShowMask="true" />
            <Plugins>
                <ext:GridFilters runat="server" ID="GridFilters1">
                    <Filters>
                        <ext:NumericFilter DataIndex="ModuleID" />
                        <ext:StringFilter DataIndex="Name" />
                        <ext:BooleanFilter DataIndex="IsEnabled" />
                        <ext:BooleanFilter DataIndex="OnAllPage" />
                    </Filters>
                </ext:GridFilters>
            </Plugins>
            <BottomBar>
                <ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="10" />
            </BottomBar>
        </ext:GridPanel>
        <ext:Window ID="wAddModule" runat="server" Collapsible="true" Height="450" Icon="ApplicationEdit"
            Title="Thêm/Sửa module" Width="850" Hidden="true" AutoDataBind="false" Maximizable="true" Minimizable="true">
            <AutoLoad Mode="IFrame" />
            <LoadMask ShowMask="true" />
        </ext:Window>
    </div>
    </form>
</body>
</html>
